using System;
using System.Collections;
using System.Diagnostics;

using Microsoft.MediaCenter.UI;


namespace MyMoviesBrowser
{
    /// <summary>
    /// This object contains the standard set of information displayed in the 
    /// gallery page UI.
    /// </summary>
    public abstract class GalleryPage : FilteredContentPage
    {
        /// <summary>
        /// The desired size for a galley item.  This will be interpreted by the 
        /// UI to control what size to allow for the thumbnails as well as how 
        /// many rows to display.
        /// </summary>
        public GalleryItemSize ItemSize
        {
            get { return itemSize; }
            set { itemSize = value; }
        }
        private GalleryItemSize itemSize;
       

        /// <summary>
        /// Helper method to load an image from our data directory.
        /// </summary>
        protected static Image LoadImage(string imageName)
        {
            try
            {
                return new Image(imageName);
            }
            catch (Exception)
            {
                //return Resources.NoImage;
                //return new Image("resx://MyMoviesBrowser/MyMoviesBrowser.Resources/NoImage");
                Debug.WriteLine("Error loading image: " + imageName);
            }

            return null;
        }
    }

    /// <summary>
    /// The possible size configurations supported by the gallery UI.
    /// </summary>
    public enum GalleryItemSize
    {
        Small,
        Large
    }
}
